<template>
          <div>
            <el-table
                :data="tableData"
                border
                style="width: 100%">
              <el-table-column
                  fixed
                  prop="id"
                  label="id"
                  width="150">
              </el-table-column>
              <el-table-column
                  prop="tradesmanName"
                  label="零售商名字"
                  width="120">
              </el-table-column>
              <el-table-column
                  prop="address"
                  label="零售商地址"
                  width="120">
              </el-table-column>
              <el-table-column
                  prop="cropId"
                  label="产品Id"
                  width="120">
              </el-table-column>
              <el-table-column
                  prop="source"
                  label="产品名"
                  width="120">
              </el-table-column>
              <el-table-column
                  label="操作"
                  width="100">
                <template slot-scope="scope">
                  <el-button @click="handleClick(scope.row)" type="text" size="small">售卖</el-button>
                  <el-button @click="xaingqing(scope.row)" type="text" size="small">详情</el-button>
                  <el-button type="text" size="small">编辑</el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-drawer size="80%" :visible.sync="cropsProcessDetaiDialog" :show-close="false" :with-header="false">
              <el-divider content-position="left">商品详情</el-divider>
              <el-table v-loading="loading" :data="cropsProcessDetailsArray">
                <el-table-column label="Id" prop="id" />
                <el-table-column label="作物" prop="source" />
                <el-table-column label="地址" prop="tradesmanName" />
                <el-table-column label="作物id" prop="cropId" />
                <el-table-column label="加工厂" prop="sname" />
                <el-table-column label="原料厂" prop="pname" />
                <el-table-column label="生产日期" prop="createdate" />
              </el-table>
            </el-drawer>
          </div>

</template>

<script>
export default {
  name: "ShopView",
  data(){
    return{
      tradesmanData:[],
      driverData:[],
      formLabelWidth:'120px',
      form:{},
      dialogFormVisible:false,
      tableData:[],
      cropsProcessDetaiDialog:false,
    }
  },methods:{

    handleClick(){

    },
    xaingqing(row) {
      this.axios
          .get( '/cropservice/outbound/gettListbyid?cropId='+ row.cropId)
          .then(res => {
            this.cropsProcessDetailsArray = res.data.data;
            this.cropsProcessDetaiDialog = true;
          })
    },
    // 零售商列表
    tradesmanShow(){
      this.axios.get("cropservice/outbound/tList").then(r=>{
        if(r.data.code==200) {
          this.tableData=r.data.data;
        }
      })
    }
  },created() {
    // 零售商列表
    this.tradesmanShow();
  }
}
</script>

<style scoped>

</style>